package com.esaf.sistema.rh;

import javax.security.auth.login.Configuration;

import org.hibernate.SessionFactory;

public class HibernateUtil {
	
	private static final SessionFactory session = buildSessionFactory();
	
	private static SessionFactory buildSessionFactory(){
		try{
			Configuration cfg = new Configuration()
			cfg.configure("hibernate.cfg.xml");
			return cfg.buildSessionFactory();
		}catch (Exception e){
			System.out.println("Fudeu! \n" + e);
			throw new ExceptionInInitializerError();
		}
	}
	public static SessionFactory getSession(){
		return session;
	}

}
